import {h} from "./snabbdom/h";
import {patch} from "./snabbdom/path";

const container = document.querySelector("#container");
const button = document.querySelector("#btn");


const vnode1 = h("section", {}, [
        h('p', {key: '1'}, '1'),
        h('p', {key: '2'}, '2'),
        h('p', {key: '3'}, '3'),
        h('p', {key: '4'}, '4'),
        h('p', {key: '5'}, '5'),

    ]
);

const vnode2 = h("section", {}, [
        h('p', {key: '1'}, '1'),
        h('p', {key: '4'}, '4'),
        h('p', {key: '3'}, '3'),
        h('p', {key: '2'}, '2'),
        h('p', {key: '5'}, '5'),
        h('p', {key: '6'}, '6'),
        h('p', {key: '7'}, '7'),


    ]
);

patch(container, vnode1)
button.addEventListener("click", () => {
    patch(vnode1, vnode2)
});
